bin/refs: Allow overwriting existing ref
authorDan Nicholson <nicholson@endlessm.com>
Mon, 10 Jun 2019 14:47:44 +0000 (09:47 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 12 Jun 2019 15:00:19 +0000 (15:00 +0000)
commitd916383953121f7bbd016a977caf85bc6f917422
tree92ea9eefbeb4d0d78696eb602ff273df5e449bc5
parent6733843f87aa3b1ad3dfe1ae76f0c76329617909
bin/refs: Allow overwriting existing ref

Currently if you want to update a non-alias ref, you need to first check
if it exists and use either `ostree refs --create` or `ostree reset` as
appropriate. That's unnecessarily complicated and is much less
convenient than the old `write-refs` builtin that simply called
`ostree_repo_set_ref_immediate()` without any checks.

Add a `--force` option to be used with `--create` that does not raise an
error when the destination ref already exists.

Closes: #1870
Approved by: jlebon
bash/ostree
man/ostree-refs.xml
src/ostree/ot-builtin-refs.c
tests/test-refs.sh